package campus.aiit.ssl.dao;

import campus.aiit.ssl.domain.model.InstructTemplate;
import campus.aiit.ssl.manage.custom.dao.BaseDao;
import campus.aiit.ssl.manage.custom.dao.DaoResultCheck;

/**
 * @author ihaokun
 * @date 2019/12/4 10:50
 */
public interface InstructTemplateDao extends BaseDao<InstructTemplate> {
  @Override@DaoResultCheck
  int deleteByPrimaryKey(Long id);

  @Override@DaoResultCheck
  int insertSelective(InstructTemplate record);

  @Override@DaoResultCheck
  int updateByPrimaryKeySelective(InstructTemplate record);

  // Unique(typeId, modelId); ForeignKeys(typeId; modelId)
  InstructTemplate[] selectByForeignKeys(long typeId, long modelId);
  Long selectIdByForeignKeys(long typeId, long modelId);

  InstructTemplate[] selectAll();

  /** @return template表中第一个模板的指令集 项数 */
  int countInstructions();
}